fix(设备管理): 限制物模型导入使用托管文件 - #780
Merged
Merged
Conversation
Closes: #766
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
fileUrl发起任意远程请求或读取本地路径的问题FileManager托管文件,保留上传后导入流程核心变动
FileUtils新增readManagedInputStream(FileManager, String)和resolveManagedFileId(String)/file/{id}的平台文件访问地址,随后直接调用FileManager;不会发起 HTTP 请求或读取本地路径DefaultImportExportService改用统一托管文件入口,删除内部重复解析逻辑ValidationExceptionFileManager设计与测试目标
FileUtils类级安全边界和新增公共方法契约测试结果
mvn -pl jetlinks-components/io-component -am -Dtest=DefaultImportExportServiceTest -Dsurefire.failIfNoSpecifiedTests=false testmvn -pl jetlinks-manager/device-manager -am -DskipTests compilereadManagedInputStream1/1 lines(100%);resolveManagedFileId27/27 lines(100%)、22/28 branches(78.6%)FileManager交互已通过单元测试替身验证,未改变数据库、消息、事件、协议或启动装配Unsupported class file major version 65,不影响测试结果及目标类报告生成文档同步情况
风险与说明
FileUtils既有通用远程/本地读取能力及其全局下载策略不在本 PR 范围;本入口不会调用该能力Closes #766